<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html lang="en">
    <head>
        
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>View Item Image</title>
        
         <!-- bootstrap & fontawesome -->
         <!--<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->baseUrl; ?>/assets/css/themes/bootstrap.min.css" />-->
          <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl; ?>/assets/font/font-awesome/css/font-awesome.min.css" />
        <!-- ace styles -->
        <!--<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->baseUrl; ?>/assets/css/ace.min_2.css" />-->
        <!-- ace styles -->
        <!--<link rel="stylesheet" href="<?php echo Yii::app()->baseUrl; ?>/assets/css/themes/ace.min.css" />-->
 <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl; ?>/assets/css/dropzone.css" />
          <!--<link rel="stylesheet" href="<?php echo Yii::app()->baseUrl; ?>/assets/css/themes/ace-skins.min.css" />-->
        <!--<link rel="stylesheet" href="<?php echo Yii::app()->baseUrl; ?>/assets/css/themes/ace-rtl.min.css" />-->
        <!-- ace settings handler -->
        <script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/ace-extra.min.js"></script>
          <script type="text/javascript" src="<?php echo Yii::app()->baseUrl; ?>/ckeditor/ckeditor.js"></script>
    </head>
    <body>
      <div class="breadcrumbs" id="breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="<?php echo Yii::app()->baseUrl; ?>">Home</a>
        </li>
        <li>
            <a href="<?php echo Yii::app()->baseUrl; ?>/item">Item</a>
        </li>        
        <li class="active">Item's Images</li>
    </ul>


</div>

<div class="page-content">
    <div class="page-header">
        <h1>
            Images
            <?php 
            $model = new UploadImage();
            $rowid = $_GET['rowid'];
            $list = json_decode($model->GetDatabase($rowid))?>
        </h1>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <form action="../site/uploadimage?id=<?php echo $rowid?>" class="dropzone" id="dropzone-image">
                <div class="fallback">
                    <input name="file" type="file" multiple />
                </div>
            </form>
            <div class="dropzone-control">
                <input class="btn btn-sm btn-primary" id="submit-upload-image" value="Upload">
                <input class="btn btn-sm btn-danger" id="submit-remove-image" value="Remove">
            </div>

            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="col-sm-12">
                        <h3 class="row header smaller lighter blue col-sm-6">
                            List Images
                        </h3>
                    </div>
                    <div>
                        <ul class="ace-thumbnails clearfix list-product-image">

                            <?php if (!empty($list) || is_array($list)) {foreach ($list as $i=>$value): ?>
                            <!--<i class=""-->
                                <li>
                                    <div>
                                        <img width="200" height="200" src="<?php echo Yii::app()->baseUrl;?>/files/<?php echo $list[$i] ?>"/>
                                        <div class="text">
                                            <div class="inner">
                                                <a href="#">
                                                    <i data-id="<?php echo $i ?>" link="../site/removeimage?pos=<?php echo $i?>&rowid=<?php echo $rowid?>" class="ace-icon fa fa-times red remove-image">
                                                    </i>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            <?php endforeach; }?>
                        </ul>
                    </div>
                </div>
            </div>

           
        </div>
    </div>
</div>
        <script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/jquery-1.11.1.min.js"></script>
                <script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/bootstrap.min.js"></script>

<!-- page specific plugin scripts -->

<!-- ace scripts -->
<script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/ace-elements.min.js"></script>
<script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/ace.min.js"></script>
<script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/dropzone.min.js"></script>
<script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/app.js"></script>
<script type="text/javascript">
function removejscssfile(filename, filetype){
 var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from
 var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
 var allsuspects=document.getElementsByTagName(targetelement)
 for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
  if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
   allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()
 }
}

//removejscssfile("somescript.js", "js") //remove all occurences of "somescript.js" on page
//removejscssfile("jquery-ui-1.10.3.full.min.css", "css");//remove all occurences "somestyle.css" on page
//removejscssfile("chosen.css", "css");
//removejscssfile("ui.jqgrid.css", "css");
//removejscssfile("datepicker.css", "css");
</script>
<script type="text/javascript">
//        removejscssfile("bootstrap.min.css", "css");
        </script>
    </body>
    <!-- basic scripts -->
<!--<script type="text/javascript">
    if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script>-->

</html>
